package com.central.scheduler.dao.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.central.db.mapper.SuperMapper;
import com.central.scheduler.dao.model.ProcessDefinition;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author Tindy
 * @date 2021/11/1
 * @describe
 * process definition mapper interface
 */
@Mapper
public interface ProcessDefinitionMapper extends SuperMapper<ProcessDefinition> {

    /**
     * query process definition by code
     *
     * @param code code
     * @return process definition
     */
    ProcessDefinition queryByCode(@Param("code") long code,@Param("proId") Long ProId);

    List<ProcessDefinition> findProcesses(Page<ProcessDefinition> page,@Param("u") Map<String, Object> params);

    List<ProcessDefinition> queryDefinitionListByCodeSet(@Param("subProcessDefineCodes") Set<Long> subProcessDefineCodes);

    Set<Long> getCodes(@Param("proId") Long proId,@Param("processName") String processName);

    List<ProcessDefinition> queryByCodes(@Param("processCodes") Set<Long> processCodes);
}
